package com.tchy.cloud.entity;

import javax.persistence.*;

import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Created by xiaoji on 2017/2/20.
 */
@Entity
@Table(name = "a_topic", schema = "", catalog = "")
public class ATopicEntity {
    private Long topicId;
    private String name;
    private Integer followNum;
    private Integer chatNum;
    private AColumnsEntity columns;
    private Integer commentNum;
    private Date createTime;
    private Integer deleted;

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "topic_id")
    public Long getTopicId() {
        return topicId;
    }

    public void setTopicId(Long topicId) {
        this.topicId = topicId;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "follow_num")
    public Integer getFollowNum() {
        return followNum;
    }

    public void setFollowNum(Integer followNum) {
        this.followNum = followNum;
    }

    @Basic
    @Column(name = "chat_num")
    public Integer getChatNum() {
        return chatNum;
    }

    public void setChatNum(Integer chatNum) {
        this.chatNum = chatNum;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "columns_id")
    public AColumnsEntity getColumns() {
        return columns;
    }

    public void setColumns(AColumnsEntity columns) {
        this.columns = columns;
    }

    @Basic
    @Column(name = "comment_num")
    public Integer getCommentNum() {
        return commentNum;
    }

    public void setCommentNum(Integer commentNum) {
        this.commentNum = commentNum;
    }

    @Basic
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "deleted")
    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }
}
